/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package lesson3.slides.text;

import java.text.MessageFormat;
import java.util.Date;
import java.util.Locale;

public class MessageFormatExample {

    public static void main(String[] args) {
        int planet = 7;
        String result = MessageFormat.format("At {1,time} on "
                + "{1,date, full}, there was {2} on planet "
                + "{0,number,integer}.", planet, new Date(),
                "a disturbance in the Force");
        System.out.println(result);
        MessageFormat mf = new MessageFormat("A {1,time} le "
                + "{1,date,full}, il y avait sur la planète numéro "
                + "{0,number,integer}, {2}.", new Locale("fr", "fr"));
        result = mf.format(new Object[]{planet, new Date(),
                    "une perturbation dans la force"});
        System.out.println(result);

    }
}
